from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.


class UserModel(AbstractUser):
    nickname = models.CharField('昵称', max_length=50, blank=True)
    avatar = models.TextField('头像', blank=True, null=True, default='')
    gender = models.CharField('性别', max_length=10, choices=(('male', '男'), ('female', '女'), ('no', '未知')), default='no')
    sign = models.CharField('权限', max_length=10, choices=(('common', '普通用户'), ('inside', '内部用户')), default='common')
    age = models.IntegerField('年龄', blank=True, null=True)
    email = models.EmailField('邮箱', unique=True)
    mobile = models.CharField('手机号', max_length=20, blank=True)
    major = models.CharField('专业', max_length=50, blank=True)
    student_id = models.IntegerField('学号', blank=True, null=True)
    introduction = models.TextField('简介', blank=True, null=True)

    class Meta:
        verbose_name = '用户'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username


